/**
 * @author: sundx
 * @date: 2020-06-07 23:17:11
 * @Last Modified by: sundx
 * @Last Modified time: 2020-06-08 01:35:46
 */
#ifndef __SERVER__
#define __SERVER__

#include "../http/http_conn.h"
#include "../threadpool/threadpool.h"

#define MAX_FD 65536
#define PORT 8997

class server {
private:
public:
  server();
  ~server();

public:
  void init();
  void eventListen(); //创建监听socket
  void eventLoop();   //主逻辑，循环

public:
  // epoll event 相关
  epoll_event events[MAX_EVENT_NUMBER];
  int m_listenFd;
  int m_epollFd;

  // http 相关
  http_conn *users; //数组，分配MAX_FD个

  //线程池相关
  threadpoll<http_conn> *m_pool;
  int m_thread_num;
};

#endif